-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graceful degradation for pruned and txindex-less nodes #279
Graceful degradation for pruned and txindex-less nodes #279
Conversation
I left some |
`txindex` related changes: - Fetch block transactions with `getrawtransaction <txid> <blockhash>`. This works without `txindex`. - Tolerate missing previous output information and render transactions without it. Pruning related changes: - Fallback to `getblockheader` instead of `getblock` for pruned blocks. The txid list and weight/size information will be missing. - Tolerate missing block stats.
…txindex is available
i.e. `/tx/<txid>?height=<height>`. This can work without txindex. When txindex is disabled, the block page links to the transactions with this parameter set.
…mempool But still avoid unnecessarily loading prevouts
Also: - Use nicer-looking /tx/<txid>@<height> URLs - Simplify by removing some unnecessary code - Fix a bug where searching for invalid block height hanged
Also changed session.userMessage to render as markdown, hopefully that's okay?
c062919
to
0cef27a
Compare
I rebased on master and added a few enhancements:
I would love some feedback @janoside, is this something you'd be willing to consider merging? |
@shesek Feedback: I love this! This change is so well suited to the philosophy of this project and I'm excited to get it merged. It's just a matter of finding time to review and test. I'll try to prioritize this over the next few days. I don't currently run any pruning nodes so there's a bit more overhead than some other PRs, but I'll make it happen soon. |
@shesek big thank you! I was actually thinking about this too but never found the time to improve it or open an issue. This will make btc-rpc-explorer more accessible to the users of my repository. |
Using the information from `getmempooletry`.
@shesek Update - Reviewing/testing is marching forward. No major issues yet and I've covered a lot of this. I have a branch feature-prune-support where I'm testing/tweaking. Hoping to wrap up by tomorrow. |
@janoside The work on your branch looks great, thanks for pushing this forward! |
I wrote a summary of the limited functionality for a project I'm working on that integrates btc-rpc-explorer, maybe useful to also mention this on (or link to this comment from) the readme? If pruning is enabled or if
|
Would it make sense to attempt to use a special I originally wanted to write an RPC proxy to do that ( |
This only works with Electrs and requires enabling BTCEXP_ELECTRUM_TXINDEX. See: romanz/electrs@a0a3d4f
@shesek awesome! That's the best kind of answer I could get. :D |
@shesek Hmm, interesting. I haven't encountered that, but reading the help info for |
After the changes I just pushed in the branch, I consider this PR feature complete. I'll be doing a bit more testing over the next couple of days. If anyone wants to review any of the recent changes or offer their own testing results that'd be great. After that, on to master. |
I've been using your branch (minus the changes from today) and its been working great. Will update and test some more. Awesome work! Excited to get this released :-) |
🚀 |
The project I was integrating btc-rpc-explorer into is eznode, which got released just now. With it, you can get a pruned node and btc-rpc-explorer running using |
@shesek That looks awesome. Congrats on the launch! |
Oh, sorry @shesek I was overwhelmed when I got your reply and then forgot about it. It indeed looks great! Perhaps the only thing I'd like to see (in Bitcoin community in general) is avoiding the situation in which each different project has its own Bitcoind. In your case you have manual override, but I'd love it to not be manual. :) |
@Kixunil How would you like this to work? Right now you can use an existing bitcoind by starting docker with |
Didn't want to spam here, so I opened ez-org/eznode#8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You guys R.O.C.K!
This is an attempt to enable as much of the functionality as possible for pruned nodes and for nodes without
txindex
.txindex
related changes:getrawtransaction <txid> <blockhash>
. This works withouttxindex
./tx/<txid>?height=<height>
and link to it from block pages.Pruning related changes:
getblockheader
instead ofgetblock
for pruned blocks. The txid list and weight/size information will be missing.Tested functionality:
Without txindex: Functional except not showing previous output information (address/amount) and the mining fee.
With pruning: Shows only the summary for pruned blocks, without the tx list.
height
query string parameter is specified. Does not show previous outputs info. Edit: Also works with wallet and recently confirmed transactions.